<html>
<head><meta charset="utf-8"><title>rebuilding inline tests faster · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html">rebuilding inline tests faster</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="240298452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rebuilding%20inline%20tests%20faster/near/240298452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Bratschi-Kaye (he) <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html#240298452">(May 26 2021 at 09:31)</a>:</h4>
<p>Hi, I'm playing around with making a change within <code>compiler/rustc_target</code> and would like to run the inline tests. I can do this with</p>
<div class="codehilite" data-code-language="Bash"><pre><span></span><code>./x.py <span class="nb">test</span> --stage <span class="m">0</span> compiler/rustc_target/
</code></pre></div>
<p>but it's pretty slow (at least on my machine) because it seems to rebuild the whole compiler each time I make change in <code>rustc_target</code>. Is there some way to just build <code>rustc_target </code> and run its tests without rebuilding all the compiler crates that depend on <code>rustc_target</code>? I didn't notice anything about this in the <code>help</code> menu or docs, but I assume I'm just missing  it.</p>



<a name="240302539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rebuilding%20inline%20tests%20faster/near/240302539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html#240302539">(May 26 2021 at 10:12)</a>:</h4>
<p><span class="user-mention" data-user-id="262963">@Adam Bratschi-Kaye (he)</span> no, not currently: <a href="https://github.com/rust-lang/rust/issues/51748">https://github.com/rust-lang/rust/issues/51748</a><br>
I'd suggest moving the tests into a separate file so the compiler doesn't have to be rebuilt.</p>



<a name="240425761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rebuilding%20inline%20tests%20faster/near/240425761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Bratschi-Kaye (he) <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html#240425761">(May 27 2021 at 06:42)</a>:</h4>
<p>Thanks for the info <span class="user-mention" data-user-id="232545">@Joshua Nelson</span>. Do you mean a separate file outside of <code>rustc_target</code>? Is there a dedicated place for tests like this? A <code>src/test/ui</code> test will still require rebuilding the whole compiler to run the test right?</p>



<a name="240456808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rebuilding%20inline%20tests%20faster/near/240456808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html#240456808">(May 27 2021 at 12:11)</a>:</h4>
<p><span class="user-mention" data-user-id="262963">@Adam Bratschi-Kaye (he)</span> no, I just mean a file in rustc_target/src/tests, like for unit tests</p>



<a name="240572603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rebuilding%20inline%20tests%20faster/near/240572603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Bratschi-Kaye (he) <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html#240572603">(May 28 2021 at 08:00)</a>:</h4>
<p>Ah I see, that'll let me change the test and re-run it without rebuilding the whole compiler, but if I make a change to the code in <code>rustc_target</code> I still need to rebuild the whole compiler before running the test, right? I was wondering if there was a way to change the code in <code>rustc_target</code> and just rebuild that crate to run my test. Should have been clearer in my original question.</p>



<a name="240583034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rebuilding%20inline%20tests%20faster/near/240583034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html#240583034">(May 28 2021 at 09:50)</a>:</h4>
<p>No, there is not a way to do that, that's the bug I linked.</p>



<a name="240710504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/rebuilding%20inline%20tests%20faster/near/240710504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Adam Bratschi-Kaye (he) <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/rebuilding.20inline.20tests.20faster.html#240710504">(May 29 2021 at 16:46)</a>:</h4>
<p>Ok, got it. Thanks for your help!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>